﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Configuration;
using System.Data;
using KPIS.GERP.GHRMS.DAL;
using KPIS.GERP.GHRMS.IBLL;

namespace KPIS.GERP.GHRMS.BLL
{
    public class JobSpecificationBLL : IJobSpecificationBLL
    {
        private static DataSet dsGrid;

        public DataSet DsGrid
        {
            get
            {
                return dsGrid;
            }
            set
            {
                dsGrid = value;
            }
        }

        public DataSet LoadListJobSpecifications()
        {
            DataSet ds = new DataSet();
            JobSpecificationDAL JobSpec = new JobSpecificationDAL();

            try
            {
                ds = JobSpec.LoadListJobSpecifications();
            }
            catch
            {
                throw new Exception("Load DataList Error");
            }
            finally
            {
                JobSpec = null;
            }

            return ds;
        }

        public DataSet LoadGridJobSpecifications()
        {
            DataSet ds = new DataSet();
            JobSpecificationDAL JobSpec = new JobSpecificationDAL();

            try
            {
                ds = JobSpec.LoadGridJobSpecifications();
            }
            catch
            {
                throw new Exception("Load DataGrid Error");
            }
            finally
            {
                JobSpec = null;
            }

            return ds;
        }

        public void Insert(string JobSpecName, string Remarks, int CreatedBy)
        {
            //D_HRM_MP_JobSpecifications JobSpec = new D_HRM_MP_JobSpecifications();

            //try
            //{
            //    return JobSpec.Insert(JobSpecName, Remarks, CreatedBy);
            //}
            //catch
            //{
            //    throw new Exception("");
            //}
            //finally
            //{
            //    JobSpec = null;
            //}
        }

        public void Update(int JobSpecSeq, string JobSpecName, string Remarks, int UpdatedBy)
        {
            //D_HRM_MP_JobSpecifications JobSpec = new D_HRM_MP_JobSpecifications();

            //int chkError = 0;

            //try
            //{
            //    chkError = JobSpec.Update(JobSpecSeq, JobSpecName, Remarks, UpdatedBy);
            //}
            //catch
            //{
            //    throw new Exception("");
            //}
            //finally
            //{
            //    JobSpec = null;
            //}

            //return chkError;
        }

        public void Delete(int JobSpecSeq, int UpdatedBy)
        {
            //D_HRM_MP_JobSpecifications JobSpec = new D_HRM_MP_JobSpecifications();

            //int chkError = 0;

            //try
            //{
            //    chkError = JobSpec.Delete(JobSpecSeq, UpdatedBy);
            //}
            //catch
            //{
            //    throw new Exception("");
            //}
            //finally
            //{
            //    JobSpec = null;
            //}

            //return chkError;
        }
    }
}
